<div class="voucher-batch">
    <div class="grid-header">
        <div class="grid-title" *ngFor="let column of columns">{{column.title}}</div>
    </div>
    <div class="grid-container">
        <div class="grid-item" *ngFor="let row of rows">
            <div class="grid-itemInfo">{{row.createdTime * 1000 | date:'yyyy-MM-dd HH:mm:ss'}}</div>
            <div class="grid-itemInfo">{{row.templateId}}</div>
            <div class="grid-itemInfo">{{row.templateName}}</div>
            <div class="grid-itemInfo">{{row.createdBy}}</div>
            <div class="grid-itemInfo">
                <span *ngIf="row.status === 0">未执行</span>
                <span *ngIf="row.status === 1"> 执行中</span>
                <span *ngIf="row.status === 2">执行完毕</span>
            </div>
            <div class="grid-itemInfo">
                <span *ngIf="row.resultNote">{{row.resultNote}}</span>
                <span *ngIf="!row.resultNote">共{{row.itemCount}}条，失败{{row.failureCount}}条</span>
            </div>
            <div class="grid-itemInfo">
                <button *ngIf="row.status === 2" class="action-btn" (click)="openResultModal(row.id)">查看结果</button>
                <button *ngIf="row.status === 0" nz-button nzType="danger" nzGhost (click)="cancelVoucher(row.id)">取消</button>
            </div>
        </div>
    </div>
    <pagination *ngIf="rows" class="pagination-sm" [(ngModel)]="page" [totalItems]="totalItems" [itemsPerPage]="itemsPerPage"
        [maxSize]="maxSize" [boundaryLinks]="true" [rotate]="false" [firstText]="localText.firstBtn" [lastText]="localText.lastBtn"
        [previousText]="localText.previousBtn" [nextText]="localText.nextBtn" (pageChanged)="onChangeTable($event)" (numPages)="numPages = $event">
    </pagination>
    <pre *ngIf="rows" class="card card-block card-header">页数: {{page}} / {{numPages}}</pre>
</div>

<!--查看结果-->
<div bsModal #pvModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"
[config]="{backdrop: 'static'}">
<div class="modal-dialog modal-lg">
    <div class="modal-content">
        <div class="modal-header">
            <h4 class="modal-title pull-left">发放结果</h4>
            <button type="button" class="close pull-right" (click)="pvModal.hide()" aria-label="Close">
      <span aria-hidden="true">&times;</span>
    </button>
        </div>
        <div class="modal-body">
            <voucher-batch-item #resultForm (closeModal)="closeModal()"></voucher-batch-item>
        </div>
    </div>
</div>
</div>